package com.example.mystoryapp2.data.network.service

import com.example.mystoryapp2.domain.Category
import com.example.mystoryapp2.domain.Story
import retrofit2.Call
import retrofit2.http.Body
import retrofit2.http.POST


/**
 * 与故事相关的接口
 */
interface StoryService {

    @POST("story/categoryList")
    fun getCategoryList(): Call<List<Category>>

    @POST("story/addStory")
    fun addStory(@Body story: Story): Call<Boolean>

    @POST("story/getStoryById")
    fun getStoryById(@Body storyId: Int): Call<Story>

    @POST("story/getUnpublishedStory")
    fun getUnpublishedStory(@Body userId: Int): Call<List<Story>>

    @POST("story/getPublishedStory")
    fun getPublishedStory(@Body userId: Int): Call<List<Story>>

    @POST("story/updateStory")
    fun updateStory(@Body story: Story): Call<Boolean>

    @POST("story/hasPage")
    fun hasPage(@Body id: Int): Call<Boolean>

    @POST("story/getCollected")
    fun getCollectedStory(@Body id: Int): Call<List<Story>>

    @POST("story/search")
    fun search(@Body story: Story): Call<List<Story>>

}